﻿/* ==============================================================================
 * 功能描述：SkillPanelDefcultSkillConfig  
 * 
 * 创 建 者：郑镇泉
 * 
 * 创建日期：2016/4/15 22:36:57
 * ==============================================================================*/
using UnityEngine;
using System.Collections;

public class SkillPanelDefcultSkillConfigProvider : BaseProvider<SkillPanelDefcultSkillConfigProvider>
{
    private SkillPanelDefcultSkillConfig skillPanelDefcultSkillConfig;

    public SkillPanelDefcultSkillConfig SkillPanelDefcultSkillConfig
    {
        get
        {
            if (skillPanelDefcultSkillConfig == null)
            {
                skillPanelDefcultSkillConfig = LoadConfig<SkillPanelDefcultSkillConfig>("/xml/SkillPanelDefcultSkillConfig.xml");
            }
            return skillPanelDefcultSkillConfig;
        }
    }

    public SkillPanelDefcultSkillConfigSkillPanelDefcultSkill[] GetAll()
    {
        return SkillPanelDefcultSkillConfig.Items;
    }

    public SkillPanelDefcultSkillConfigSkillPanelDefcultSkill GetSkillById(int id)
    {
        SkillPanelDefcultSkillConfigSkillPanelDefcultSkill goods = System.Array.Find<SkillPanelDefcultSkillConfigSkillPanelDefcultSkill>(SkillPanelDefcultSkillConfig.Items, (SkillPanelDefcultSkillConfigSkillPanelDefcultSkill obj) =>
        {
            return int.Parse(obj.id) == id;
        });
        if (goods == null) Debug.Log("配置表中找不到该物品，id：" + id);
        return goods;
    }
}